home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacFormat 1997 February
/
macformat-047.iso
/
Shareware Plus
/
Developers
/
The Gray Council 1.2.1
/
source
/
PowerPlant
/
GrayCouncilPP.h
< prev
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
NeXTSTEP
RISC OS/Acorn
UTF-8
Wrap
Text File
|
1996-11-07
|
48.1 KB
|
1,617 lines
|
[
TEXT/CWIE
]
//
// The Gray Council PowerPlant Adapter
// Copyright ©1996 by Trygve Isaacson. All Rights Reserved.
//
// PowerPlant adapter classes for The Gray Council.
//
// Before using any of the Gray Council source code, read and
// follow the licensing info in the accompanying documentation
// or contact:
// <trygve@bombaydigital.com>
// <http://www.bombaydigital.com>
//
// Also check the web site above to make sure you have the latest version!
//
// The Gray Council provides a set of standard C++ classes that implement
// the standard Apple Grayscale Appearance. The core classes do not
// require any other code such as a particular class framework.
//
// This file defines a set of helper classes that derive from standard
// PowerPlant classes, and interface with the core Gray Council code.
// There are also a couple of attachment subclasses for attaching to
// other pane classes to get a white background and 3D frame.
//
// Normally, to use a Gray Council PowerPlant class, you can simply change the
// class ID of the pane in your Constructor window resource to the
// class ID of the appropriate Gray Council PowerPlant adapter class. For
// example, to use the GC pushbutton, create a normal LButton pane,
// and set its class ID to 'GCpb'. Voila. This also works for the LAttachment
// subclasses defined here.
//
// A couple of the classes use the mUserCon field of the subview to specify
// additional information such as icon IDs, string resource IDs, etc.
//
// If the mUserCon usage conflicts with what you are already doing with it,
// you can use the "extended" pane subclasses (those whose class name ends
// in "PPX" instead of "PP"). These classes read their additional info from
// the pane resource stream instead of using mUserCon. In some cases they
// let you specify additional options in the pane resource that you would
// otherwise have to specify programmatically. The supplied resource file
// named GCCustomPanes.rsrc contains the 'CPPb' custom pane types.
// If you put this file in the Constructor app's folder, or keep it open
// whenever your pane resource file is open, or paste the custom pane
// types into your pane resource file, you can use the extended pane classes
// in Constructor.
//
// Each class here that interfaces to a core AGAObject has a public
// member variable called mAGAObject that points to the actual AGAObject
// subclass object. Certain extended object settings (such as mixed-state
// buttons, proportional and live scrolling, etc.) require you to call
// the AGAObject to set it. The member variable is made public to keep
// these PowerPlant classes as lightweight as possible; you make the call,
// rather than using myriad new functions of the PowerPlant AGA subclasses.
//
// Classes defined below:
// AGAWindowPP -- LWindow subclass that draws a gray background, with the
// background type depending on the LWindow windAttr_Modal flag.
// AGAWindowPPX -- AGAWindowPP (LWindow) subclass, that uses extended
// CPPb data to determine the background type.
// AGADialogBoxPP -- LDialogBox subclass that draws a gray background, with
// the background type depending on the WDEF procID and the LWindow
// windAttr_Modal flag, and replaces the PowerPlant default button outline
// by altering the style of the default button AGAPushButton object.
// AGAWindowPPX -- AGADialogBoxPP (LDialogBox) subclass, that uses extended
// CPPb data to determine the background type.
// AGAPushButtonPP -- LStdButton subclass for AGAPushButton.
// AGACheckBoxPP -- LStdCheckBox subclass for AGACheckBox.
// AGARadioButtonPP -- LStdRadioButton subclass for AGARadioButton.
// AGAIconPushButtonPP -- AGAPushButtonPP (LStdButton) subclass for
// AGAIconPushButton.
// AGAIconPushButtonPPX -- AGAIconPushButtonPP (LStdButton) subclass for
// AGAIconPushButton, that uses extended CPPb data for the icon ID.
// AGAIconCheckBoxPP -- AGACheckBoxPP (LStdCheckBox) subclass for
// AGAIconCheckBox.
// AGAIconCheckBoxPPX -- AGAIconCheckBoxPP (LStdCheckBox) subclass for
// AGAIconCheckBox, that uses extended CPPb data for the icon IDs.
// AGAIconRadioButtonPP -- AGARadioButtonPP (LStdRadioButton) subclass
// for AGAIconRadioButton.
// AGAIconRadioButtonPPX -- AGAIconRadioButtonPP (LStdRadioButton) subclass
// for AGAIconRadioButton, that uses extended CPPb data for the icon IDs.
// AGAGroupBoxPP -- LGroupBox subclass for AGAGroupBox, with primary group
// box appearance.
// AGAGroupBoxPPX -- AGAGroupBoxPP (LGroupBox) subclass for AGAGroupBox,
// that uses extended CPPb data for the box type and gap pane ID.
// AGASecondaryGroupBoxPP -- AGAGroupBoxPP (LGroupBox) subclass for
// AGAGroupBox, with secondary group box appearance.
// AGAScrollBarPP -- LStdControl subclass for AGAScrollBar.
// AGAScrollerPP -- LScroller subclass that replaces the normal LStdControl
// scroll bars with ones of class AGAScrollBarPP, and correctly
// maintain them during scrolling.
// AGAActiveScrollerPP -- LActiveScroller replacement; actually an AGAScrollerPP
// subclass that sets the AGA scroll bars for live scrolling.
// AGASliderPP -- LControl subclass for AGASlider.
// AGASliderPPX -- AGASliderPP (LControl) subclass for AGASlider, that
// uses extended CPPb data for the label strings ID, style, and
// slider justification.
// AGALittleArrowsPP -- LControl subclass for AGALittleArrows.
// AGALittleArrowsPPX -- AGALittleArrowsPP (LControl) subclass for
// AGALittleArrows, that uses extended CPPb data for the linked
// numeric LEditField pane ID.
// AGAPopupMenuPP -- LStdPopupMenu subclass for AGAPopupMenu.
// AGADisclosureTrianglePP -- LControl subclass for AGADisclosureTriangle.
// AGAProgressIndicatorPP -- LControl subclass for AGAProgressIndicator.
// AGAWhiteBackgroundAttachmentPP -- LAttachment subclass that draws a
// white background for the pane to which it is attached.
// AGANotchedWhiteBackgroundAttachmentPP -- AGAWhiteBackgroundAttachmentPP (LAttachment)
// subclass that avoids painting the "notch" at the bottom right.
// AGABorderFrameAttachmentPP -- LAttachment subclass that draws a
// "3D" sunken frame around the pane to which it is attached.
// AGANotchedBorderFrameAttachmentPP -- AGABorderFrameAttachmentPP (LAttachment)
// subclass that accounts for the "notch" at the bottom right.
// AGAEditFieldPP -- LEditField subclass that automatically attaches an
// AGAWhiteBackgroundAttachmentPP and an AGABorderFrameAttachmentPP,
// and also knows how to draw the frame in disabled gray when disabled.
// AGATextEditPP -- LTextEdit subclass that automatically attaches an
// AGAWhiteBackgroundAttachmentPP and an AGABorderFrameAttachmentPP.
// AGASeparatorPP -- LPane subclass for AGASeparator.
// AGACaptionPP -- LCaption subclass for AGAStaticText.
// AGAListBoxPP -- LListBox subclass that automatically attaches an
// AGAWhiteBackgroundAttachmentPP and an AGABorderFrameAttachmentPP,
// and also replaces the normal LFocusBox with an AGAFocusBoxPP so
// that the focus frame appears correct.
// AGANotchedListBoxPP -- AGAListBoxPP (LListBox) subclass that uses an
// AGANotchedWhiteBackgroundAttachmentPP instead of an AGAWhiteBackgroundAttachmentPP.
// AGANotchedFocusListBoxPP -- AGANotchedListBoxPP (LListBox) subclass that
// uses both an AGANotchedWhiteBackgroundAttachmentPP instead of an
// AGAWhiteBackgroundAttachmentPP, and an AGANotchedFocusBoxPP instead of
// an AGAFocusBoxPP.
// AGAFocusBoxPP -- LFocusBox subclass used by AGAListBox to draw the
// list box focus frame.
// AGANotchedFocusBoxPP -- AGAFocusBoxPP (LFocusBox) subclass that draws the
// focus box fitted to the "notch" in the bottom right corner.
// AGAPanelEnclosurePP -- LView+LCommander subclass, used by AGATabPanelPP to
// handle target activation/deactivation between targets inside panels.
// AGATabPanelPP -- LView subclass for AGATabPanel, set for standard large
// tab format using the system font.
// AGATabPanelPPX -- AGATabPanelPP (LView) subclass for AGATabPanel, that
// uses extended CPPb data for the label strings ID, and text traits ID.
// The font size of the text traits resource determines whether the tabs
// are small or large format.
// AGASmallTabPanelPP -- AGATabPanelPP (LView) subclass for AGATabPanel, set
// for standard small tab format using Geneva 10 bold.
//
#pragma once
#ifndef __GRAYCOUNCILPP__
#define __GRAYCOUNCILPP__
#include <LAttachment.h>
#include <LCaption.h>
#include <LControl.h>
#include <LDialogBox.h>
#include <LEditField.h>
#include <LFocusBox.h>
#include <LGroupBox.h>
#include <LListBox.h>
#include <LScroller.h>
#include <LStdControl.h>
#include <LStream.h>
#include <LTextEdit.h>
#include <LWindow.h>
#include <UDrawingState.h>
#include <URegistrar.h>
#include <UTextTraits.h>
#include "GrayCouncil.h"
//
// You must call InitGrayCouncilPP after initializing PowerPlant and the
// Toolbox and before instantiating any GrayCouncil objects. This routine
// registers the PowerPlant classes and then calls the core InitGrayCouncil
// function for you. If it returns an error, you should quit. The only
// current error situation of this is an out-of-memory condition
// during initialization.
// Alternatively, you can manually register just the adapter classes that
// you will use, and then call InitGrayCouncil.
//
extern OSErr InitGrayCouncilPP();
#pragma mark AGAWindowPP
//
// AGAWindowPP ----------------------------------------------------
//
// LWindow replacement subclass.
// Makes sure the background is painted gray.
// Knows how to shade around the grow box.
//
class AGAWindowPP : public LWindow
{
public:
AGAWindowPP(LStream* inStream);
virtual ~AGAWindowPP();
enum { class_ID = 'GCwn' };
static AGAWindowPP* CreateStream(LStream* inStream);
// PowerPlant overrides
virtual void FinishCreate();
virtual void DrawSelf();
virtual void ResizeFrameBy(Int16 inWidthDelta, Int16 inHeightDelta, Boolean inRefresh);
protected:
// PowerPlant overrides
virtual void FinishCreateSelf();
virtual void ActivateSelf();
virtual void DeactivateSelf();
virtual void DrawBackground(const Rect* area, Boolean fill, Boolean active);
virtual void InvalidateEdges(Boolean before, Int16 inWidthDelta, Int16 inHeightDelta);
AGABackgroundKind mBackgroundKind;
};
#pragma mark AGAWindowPPX
//
// AGAWindowPPX ----------------------------------------------------
//
// Extended AGAWindowPP class for use with custom pane template.
// The background kind is read from the stream rather than determined
// by checking the window's "modal" attribute.
//
class AGAWindowPPX : public AGAWindowPP
{
public:
AGAWindowPPX(LStream* inStream);
virtual ~AGAWindowPPX();
enum { class_ID = 'GXwn' };
static AGAWindowPPX* CreateStream(LStream* inStream);
};
#pragma mark AGADialogBoxPP
//
// AGADialogBoxPP ----------------------------------------------------
//
// LDialogBox replacement subclass.
// Makes sure the background is painted gray and the default
// button is drawn with an AGA-style default outline.
// Knows how to shade around the grow box.
//
class AGADialogBoxPP : public LDialogBox
{
public:
AGADialogBoxPP(LStream* inStream);
virtual ~AGADialogBoxPP();
enum { class_ID = 'GCdb' };
static AGADialogBoxPP* CreateStream(LStream* inStream);
// PowerPlant overrides
virtual void FinishCreate();
virtual void SetDefaultButton(PaneIDT inButtonID);
virtual void DrawSelf();
virtual void ResizeFrameBy(Int16 inWidthDelta, Int16 inHeightDelta, Boolean inRefresh);
protected:
// PowerPlant overrides
virtual void FinishCreateSelf();
virtual void ActivateSelf();
virtual void DeactivateSelf();
virtual void DrawBackground(const Rect* area, Boolean fill, Boolean active);
virtual void InvalidateEdges(Boolean before, Int16 inWidthDelta, Int16 inHeightDelta);
Boolean mDeleteDefaultOutline;
AGABackgroundKind mBackgroundKind;
};
#pragma mark AGADialogBoxPPX
//
// AGADialogBoxPPX ----------------------------------------------------
//
// Extended AGADialogBoxPP class for use with custom pane template.
// The background kind is read from the stream rather than determined
// by peeking at the WIND resource.
//
class AGADialogBoxPPX : public AGADialogBoxPP
{
public:
AGADialogBoxPPX(LStream* inStream);
virtual ~AGADialogBoxPPX();
enum { class_ID = 'GXdb' };
static AGADialogBoxPPX* CreateStream(LStream* inStream);
};
#pragma mark AGAPushButtonPP
//
// AGAPushButtonPP ----------------------------------------------------
//
// LStdButton replacement subclass.
//
class AGAPushButtonPP : public LStdButton
{
public:
AGAPushButtonPP();
AGAPushButtonPP(LStream* inStream);
virtual ~AGAPushButtonPP();
AGAPushButton* mAGAObject;
enum { class_ID = 'GCpb' };
static AGAPushButtonPP* CreateStream(LStream* inStream);
// PowerPlant overrides
virtual void SetDescriptor(ConstStringPtr inDescriptor);
virtual void ResizeFrameBy(Int16 inWidthDelta, Int16 inHeightDelta, Boolean inRefresh);
virtual void MoveBy(Int32 inHorizDelta, Int32 inVertDelta, Boolean inRefresh);
protected:
// PowerPlant overrides
virtual void FinishCreateSelf();
virtual void DrawSelf();
virtual void ClickSelf(const SMouseDownEvent &inMouseDown);
virtual void HotSpotAction(SInt16 inHotSpot, Boolean inCurrInside, Boolean inPrevInside);
virtual void EnableSelf();
virtual void DisableSelf();
virtual void ShowSelf();
virtual void CreateAGAObject();
};
#pragma mark AGACheckBoxPP
//
// AGACheckBoxPP ----------------------------------------------------
//
// LStdCheckBox replacement subclass. To use mixed-state capability,
// set/get the AGACheckBox state directly.
//
class AGACheckBoxPP : public LStdCheckBox
{
public:
AGACheckBoxPP();
AGACheckBoxPP(LStream* inStream);
virtual ~AGACheckBoxPP();
AGACheckBox* mAGAObject;
enum { class_ID = 'GCcb' };
static AGACheckBoxPP* CreateStream(LStream* inStream);
// PowerPlant overrides
virtual void SetDescriptor(ConstStringPtr inDescriptor);
virtual void ResizeFrameBy(Int16 inWidthDelta, Int16 inHeightDelta, Boolean inRefresh);
virtual void MoveBy(Int32 inHorizDelta, Int32 inVertDelta, Boolean inRefresh);
virtual void SetValue(SInt32 inValue);
protected:
// PowerPlant overrides
virtual void FinishCreateSelf();
virtual void DrawSelf();
virtual void ClickSelf(const SMouseDownEvent &inMouseDown);
virtual void HotSpotAction(SInt16 inHotSpot, Boolean inCurrInside, Boolean inPrevInside);
virtual void EnableSelf();
virtual void DisableSelf();
virtual void ShowSelf();
virtual void CreateAGAObject();
};
#pragma mark AGARadioButtonPP
//
// AGARadioButtonPP ----------------------------------------------------
//
// LStdRadioButton replacement subclass. To use mixed-state capability,
// set/get the AGARadioButton state directly.
//
class AGARadioButtonPP : public LStdRadioButton
{
public:
AGARadioButtonPP();
AGARadioButtonPP(LStream* inStream);
virtual ~AGARadioButtonPP();
AGARadioButton* mAGAObject;
enum { class_ID = 'GCrb' };
static AGARadioButtonPP* CreateStream(LStream* inStream);
// PowerPlant overrides
virtual void SetDescriptor(ConstStringPtr inDescriptor);
virtual void ResizeFrameBy(Int16 inWidthDelta, Int16 inHeightDelta, Boolean inRefresh);
virtual void MoveBy(Int32 inHorizDelta, Int32 inVertDelta, Boolean inRefresh);
virtual void SetValue(SInt32 inValue);
protected:
// PowerPlant overrides
virtual void FinishCreateSelf();
virtual void DrawSelf();
virtual void ClickSelf(const SMouseDownEvent &inMouseDown);
virtual void HotSpotAction(SInt16 inHotSpot, Boolean inCurrInside, Boolean inPrevInside);
virtual void EnableSelf();
virtual void DisableSelf();
virtual void ShowSelf();
virtual void CreateAGAObject();
};
#pragma mark AGAIconPushButtonPP
//
// AGAIconPushButtonPP ----------------------------------------------------
//
// LStdButton replacement subclass that implements an icon button that behaves
// like an LStdButton -- you click it does its HotSpotResult. The mUserCon is
// used to obtain the button's icon ID. You can also set the icon ID of the
// AGAIconPushButton directly (cast the mAGAObject to AGAIconPushButton*).
//
class AGAIconPushButtonPP : public AGAPushButtonPP
{
public:
AGAIconPushButtonPP();
AGAIconPushButtonPP(LStream* inStream);
virtual ~AGAIconPushButtonPP();
enum { class_ID = 'GCip' };
static AGAIconPushButtonPP* CreateStream(LStream* inStream);
protected:
virtual void CreateAGAObject();
// Extra AGA object initialization values
SInt16 mIconID;
MIconButtonObject::ButtonFrameType mFrameType;
MIconButtonObject::ButtonImageType mImageType;
};
#pragma mark AGAIconPushButtonPPX
//
// AGAIconPushButtonPPX ----------------------------------------------------
//
// Extended AGAIconPushButtonPP class for use with custom pane template.
// The icon ID is read from the stream.
//
class AGAIconPushButtonPPX : public AGAIconPushButtonPP
{
public:
AGAIconPushButtonPPX(LStream* inStream);
virtual ~AGAIconPushButtonPPX();
enum { class_ID = 'GXip' };
static AGAIconPushButtonPPX* CreateStream(LStream* inStream);
};
#pragma mark AGAIconCheckBoxPP
//
// AGAIconCheckBoxPP ----------------------------------------------------
//
// LStdCheckBox replacement subclass that implements an icon button that behaves
// like a check box -- you click it and it toggles its on/off state. The mUserCon
// is used to obtain the button's icon ID. You can also set the icon ID of the
// AGAIconCheckBox directly (cast the mAGAObject to AGAIconCheckBox*). If you want
// the on/off states to have different icons, you can specify different icon IDs.
//
class AGAIconCheckBoxPP : public AGACheckBoxPP
{
public:
AGAIconCheckBoxPP();
AGAIconCheckBoxPP(LStream* inStream);
virtual ~AGAIconCheckBoxPP();
enum { class_ID = 'GCic' };
static AGAIconCheckBoxPP* CreateStream(LStream* inStream);
protected:
virtual void CreateAGAObject();
// Extra AGA object initialization values
SInt16 mOffIconID;
SInt16 mOnIconID;
MIconButtonObject::ButtonFrameType mFrameType;
MIconButtonObject::ButtonImageType mImageType;
};
#pragma mark AGAIconCheckBoxPPX
//
// AGAIconCheckBoxPPX ----------------------------------------------------
//
// Extended AGAIconCheckBoxPP class for use with custom pane template.
// The off and on icon IDs are read from the stream.
//
class AGAIconCheckBoxPPX : public AGAIconCheckBoxPP
{
public:
AGAIconCheckBoxPPX(LStream* inStream);
virtual ~AGAIconCheckBoxPPX();
enum { class_ID = 'GXic' };
static AGAIconCheckBoxPPX* CreateStream(LStream* inStream);
};
#pragma mark AGAIconRadioButtonPP
//
// AGAIconRadioButtonPP ----------------------------------------------------
//
// LStdRadioButton replacement subclass that implements an icon button that behaves
// like a radio button -- you click it and it turns on, and the others in its
// tab group are turned off. The mUserCon is used to obtain the
// button's icon ID. You can also set the icon ID of the AGAIconRadioButton
// directly (cast the mAGAObject to AGAIconRadioButton*). If you want the on/off
// states to have different icons, you can specify different icon IDs.
//
class AGAIconRadioButtonPP : public AGARadioButtonPP
{
public:
AGAIconRadioButtonPP();
AGAIconRadioButtonPP(LStream* inStream);
virtual ~AGAIconRadioButtonPP();
enum { class_ID = 'GCir' };
static AGAIconRadioButtonPP* CreateStream(LStream* inStream);
protected:
virtual void CreateAGAObject();
// Extra AGA object initialization values
SInt16 mOffIconID;
SInt16 mOnIconID;
MIconButtonObject::ButtonFrameType mFrameType;
MIconButtonObject::ButtonImageType mImageType;
};
#pragma mark AGAIconRadioButtonPPX
//
// AGAIconRadioButtonPPX ----------------------------------------------------
//
// Extended AGAIconRadioButtonPP class for use with custom pane template.
// The off and on icon IDs are read from the stream.
//
class AGAIconRadioButtonPPX : public AGAIconRadioButtonPP
{
public:
AGAIconRadioButtonPPX(LStream* inStream);
virtual ~AGAIconRadioButtonPPX();
enum { class_ID = 'GXir' };
static AGAIconRadioButtonPPX* CreateStream(LStream* inStream);
};
#pragma mark AGAGroupBoxPP
//
// AGAGroupBoxPP ----------------------------------------------------
//
// LGroupBox replacement subclass. Defaults to primary group box type.
//
class AGAGroupBoxPP : public LGroupBox
{
public:
AGAGroupBoxPP();
AGAGroupBoxPP(LStream* inStream);
virtual ~AGAGroupBoxPP();
AGAGroupBox* mAGAObject;
enum { class_ID = 'GCgb' };
static AGAGroupBoxPP* CreateStream(LStream* inStream);
// PowerPlant overrides
virtual void SetDescriptor(ConstStringPtr inDescriptor);
virtual void ResizeFrameBy(Int16 inWidthDelta, Int16 inHeightDelta, Boolean inRefresh);
virtual void MoveBy(Int32 inHorizDelta, Int32 inVertDelta, Boolean inRefresh);
protected:
// PowerPlant overrides
virtual void FinishCreateSelf();
virtual void DrawSelf();
virtual void EnableSelf();
virtual void DisableSelf();
virtual void CreateAGAObject();
// Extra AGA object initialization values
Boolean mIsPrimaryGroup;
OSType mGapPaneID;
};
#pragma mark AGAGroupBoxPPX
//
// AGAGroupBoxPPX ----------------------------------------------------
//
// Extended AGAGroupBoxPP class for use with custom pane template.
// The group box type and the gap pane ID are read from the stream.
//
class AGAGroupBoxPPX : public AGAGroupBoxPP
{
public:
AGAGroupBoxPPX(LStream* inStream);
virtual ~AGAGroupBoxPPX();
enum { class_ID = 'GXgb' };
static AGAGroupBoxPPX* CreateStream(LStream* inStream);
};
#pragma mark AGASecondaryGroupBoxPP
//
// AGASecondaryGroupBoxPP ----------------------------------------------------
//
// LGroupBox replacement subclass with secondary group box type.
//
class AGASecondaryGroupBoxPP : public AGAGroupBoxPP
{
public:
AGASecondaryGroupBoxPP();
AGASecondaryGroupBoxPP(LStream* inStream);
virtual ~AGASecondaryGroupBoxPP();
enum { class_ID = 'GCgs' };
static AGASecondaryGroupBoxPP* CreateStream(LStream* inStream);
};
#pragma mark AGAScrollBarPP
//
// AGAScrollBarPP -------------------------------------------------------
//
// LStdControl/scrollBarProc replacement subclass. To use live scrolling, set the
// AGAScrollBar state directly and either install a notification routine
// or handle the scroll bar's fEventNumber by checking the current value.
// To use proportional indicator, set the AGAScrollBar state directly.
//
// Note that LScroller instantiates its scroll bars for you, so you
// don't need to know about this class when it's being used as part of
// an AGAScrollerPP (LScroller) or AGAActiveScroller (LActiveScroller).
//
typedef void (*AGANotifyPPPtr)(LPane* theIndicator, SInt32 dataValue, void* userData);
class AGAScrollBarPP : public LStdControl
{
public:
AGAScrollBarPP();
AGAScrollBarPP(LStream* inStream);
AGAScrollBarPP(const SPaneInfo &inPaneInfo,
MessageT inValueMessage,
Int32 inValue,
Int32 inMinValue,
Int32 inMaxValue,
Int16 inControlKind,
ResIDT inTextTraitsID,
Str255 inTitle,
Int32 inMacRefCon,
Boolean liveScrolling);
virtual ~AGAScrollBarPP();
AGAScrollBar* mAGAObject;
enum { class_ID = 'GCsb' };
static AGAScrollBarPP* CreateStream(LStream* inStream);
// PowerPlant overrides
virtual void ResizeFrameBy(Int16 inWidthDelta, Int16 inHeightDelta, Boolean inRefresh);
virtual void MoveBy(Int32 inHorizDelta, Int32 inVertDelta, Boolean inRefresh);
virtual void SetValue(SInt32 inValue);
virtual void SetMinValue(SInt32 inMinValue);
virtual void SetMaxValue(SInt32 inMaxValue);
virtual void InstallNotificationRoutine(AGANotifyPPPtr notificationRoutine, void* userData);
virtual void HandleNotification(SInt32 dataValue);
AGANotifyPPPtr mNotificationRoutine;
void* mUserData;
protected:
// PowerPlant overrides
virtual void FinishCreateSelf();
virtual void DrawSelf();
virtual void ClickSelf(const SMouseDownEvent &inMouseDown);
virtual void EnableSelf();
virtual void DisableSelf();
virtual void ShowSelf();
virtual void CreateAGAObject();
static void RealAGANotifier(AGATrackingIndicator* theIndicator, SInt32 dataValue, void* userData);
Boolean mInitWithLiveScrolling;
};
#pragma mark AGAScrollerPP
//
// AGAScrollerPP ----------------------------------------------------
//
// LScroller replacement subclass that creates AGAScrollBarPP objects
// rather than LStdControl/scrollBarProc objects. The scroll bars are
// initialized with live scrolling turned off.
//
// The ugly part is that there's no single bottleneck for creating
// the scroll bars. MakeScrollBars is declared private, so we cannot
// override that. Basically we have to postprocess each constructor
// and make new scroll bars to replace the old ones.
//
class AGAScrollerPP : public LScroller
{
public:
AGAScrollerPP();
AGAScrollerPP(LStream* inStream);
AGAScrollerPP(LStream* inStream, Boolean liveTracking);
virtual ~AGAScrollerPP();
enum { class_ID = 'GCsc' };
static AGAScrollerPP* CreateStream(LStream* inStream);
virtual void HandleNotification(LPane* theScrollBar, SInt32 dataValue);
protected:
// PowerPlant overrides
virtual void FinishCreateSelf();
virtual void AdjustScrollBars();
virtual void MakeCustomScrollBars(Int16 inHorizBarLeftIndent, Int16 inHorizBarRightIndent, Int16 inVertBarTopIndent, Int16 inVertBarBottomIndent, Boolean liveTracking);
virtual AGAScrollBarPP* MakeCustomScrollBar(const SPaneInfo& barInfo, Boolean liveTracking);
LStdControl *mOldVerticalBar;
LStdControl *mOldHorizontalBar;
static void ScrollBarNotifier(LPane* theScrollBar, SInt32 dataValue, void* userData);
};
#pragma mark AGAActiveScrollerPP
//
// AGAActiveScrollerPP ----------------------------------------------------
//
// LActiveScroller replacement subclass that creates AGAScrollBarPP objects
// rather than LStdControl/scrollBarProc objects. The scroll bars are
// initialized with live scrolling turned on.
//
class AGAActiveScrollerPP : public AGAScrollerPP
{
public:
AGAActiveScrollerPP();
AGAActiveScrollerPP(LStream* inStream);
virtual ~AGAActiveScrollerPP();
enum { class_ID = 'GCas' };
static AGAActiveScrollerPP* CreateStream(LStream* inStream);
};
#pragma mark AGASliderPP
//
// AGASliderPP -------------------------------------------------------
//
// LControl subclass. To set/get the value, use the LControl value
// methods. The mUserCon is used as the resource ID of an 'STR#' resource
// that contains the slider labels; in this case, the range is
// automatically set to match the number of labels, and the slider
// will have a pointy indicator. If the ID is zero or invalid, the
// slider will be rectangular.
//
class AGASliderPP : public LControl
{
public:
AGASliderPP();
AGASliderPP(LStream* inStream);
virtual ~AGASliderPP();
AGASlider* mAGAObject;
enum { class_ID = 'GCsl' };
static AGASliderPP* CreateStream(LStream* inStream);
// PowerPlant overrides
virtual void ResizeFrameBy(Int16 inWidthDelta, Int16 inHeightDelta, Boolean inRefresh);
virtual void MoveBy(Int32 inHorizDelta, Int32 inVertDelta, Boolean inRefresh);
virtual void SetValue(SInt32 inValue);
virtual void SetMinValue(SInt32 inMinValue);
virtual void SetMaxValue(SInt32 inMaxValue);
virtual void InstallNotificationRoutine(AGANotifyPPPtr notificationRoutine, void* userData);
virtual void HandleNotification(SInt32 dataValue);
AGANotifyPPPtr mNotificationRoutine;
void* mUserData;
protected:
// PowerPlant overrides
virtual void FinishCreateSelf();
virtual void DrawSelf();
virtual void ClickSelf(const SMouseDownEvent &inMouseDown);
virtual void EnableSelf();
virtual void DisableSelf();
virtual void HotSpotResult(SInt16 inHotSpot);
virtual void CreateAGAObject();
static void RealAGANotifier(AGATrackingIndicator* theIndicator, SInt32 dataValue, void* userData);
// Extra AGA object initialization values
ResIDT mLabelsResourceID;
ResIDT mLabelsTextTraitsID; // -1 for standard slider labels style
SInt32 mSliderJustification; // not used for unlabled sliders
};
#pragma mark AGASliderPPX
//
// AGASliderPPX -------------------------------------------------------
//
// Extended AGASliderPP class for use with custom pane template.
// The labels STR# resource ID, text traits ID, and justification
// are read from the stream.
//
class AGASliderPPX : public AGASliderPP
{
public:
AGASliderPPX(LStream* inStream);
virtual ~AGASliderPPX();
enum { class_ID = 'GXsl' };
static AGASliderPPX* CreateStream(LStream* inStream);
};
#pragma mark AGALittleArrowsPP
//
// AGALittleArrowsPP -------------------------------------------------------
//
// LControl subclass. You will need to either install a notification
// routine to respond to arrow tracking, or subclass and override
// the HandleNotification member function. However:
//
// If you simply want to link the little arrows to a number LEditField
// pane, just put the LEditField's pane ID the little arrows pane's
// mUserCon, and the arrows will automatically increment/decrement
// the LEditField view's value, within the value range of the little
// arrows LControl settings.
//
class AGALittleArrowsPP : public LControl
{
public:
AGALittleArrowsPP();
AGALittleArrowsPP(LStream* inStream);
virtual ~AGALittleArrowsPP();
virtual void InstallNotificationRoutine(AGANotifyPPPtr notificationRoutine, void* userData);
virtual void HandleNotification(SInt32 deltaValue);
AGANotifyPPPtr mNotificationRoutine;
void* mUserData;
AGALittleArrows* mAGAObject;
enum { class_ID = 'GCla' };
static AGALittleArrowsPP* CreateStream(LStream* inStream);
// PowerPlant overrides
virtual void ResizeFrameBy(Int16 inWidthDelta, Int16 inHeightDelta, Boolean inRefresh);
virtual void MoveBy(Int32 inHorizDelta, Int32 inVertDelta, Boolean inRefresh);
protected:
// PowerPlant overrides
virtual void FinishCreateSelf();
virtual void DrawSelf();
virtual void ClickSelf(const SMouseDownEvent &inMouseDown);
virtual void EnableSelf();
virtual void DisableSelf();
virtual void CreateAGAObject();
static void RealAGANotifier(AGALittleArrows* theAGAObject, SInt32 deltaValue, void* userData);
LEditField* mLinkedNumberText;
// Extra AGA object initialization values
OSType mLinkedPaneID;
};
#pragma mark AGALittleArrowsPPX
//
// AGALittleArrowsPPX -------------------------------------------------------
//
// Extended AGALittleArrowsPP class for use with custom pane template.
// The linked LEditField pane ID is read from the stream.
//
class AGALittleArrowsPPX : public AGALittleArrowsPP
{
public:
AGALittleArrowsPPX(LStream* inStream);
virtual ~AGALittleArrowsPPX();
enum { class_ID = 'GXla' };
static AGALittleArrowsPPX* CreateStream(LStream* inStream);
};
#pragma mark AGAPopupMenuPP
//
// AGAPopupMenuPP -------------------------------------------------------
//
// LStdPopupMenu replacement subclass that implements an AGA popup menu.
//
class AGAPopupMenuPP : public LStdPopupMenu
{
public:
AGAPopupMenuPP(LStream* inStream);
virtual ~AGAPopupMenuPP();
AGAPopupMenu* mAGAObject;
enum { class_ID = 'GCpo' };
static AGAPopupMenuPP* CreateStream(LStream* inStream);
// PowerPlant overrides
virtual void ResizeFrameBy(Int16 inWidthDelta, Int16 inHeightDelta, Boolean inRefresh);
virtual void MoveBy(Int32 inHorizDelta, Int32 inVertDelta, Boolean inRefresh);
virtual void SetValue(SInt32 inValue);
protected:
// PowerPlant overrides
virtual void FinishCreateSelf();
virtual void DrawSelf();
virtual void ClickSelf(const SMouseDownEvent &inMouseDown);
virtual void EnableSelf();
virtual void DisableSelf();
virtual void ShowSelf();
virtual void CreateAGAObject();
SInt32 mStashedTitleVariation;
SInt16 mStashedTitleWidth;
};
#pragma mark AGADisclosureTrianglePP
//
// AGADisclosureTrianglePP -------------------------------------------------------
//
// LControl subclass Set/get the AGADisclosureTriangle state
// directly. Think of it as a check box -- it's either on or off.
// The initial on/off value is taken from the LControl value.
//
class AGADisclosureTrianglePP : public LControl
{
public:
AGADisclosureTrianglePP();
AGADisclosureTrianglePP(LStream* inStream);
virtual ~AGADisclosureTrianglePP();
AGADisclosureTriangle* mAGAObject;
enum { class_ID = 'GCdt' };
static AGADisclosureTrianglePP* CreateStream(LStream* inStream);
// PowerPlant overrides
virtual void ResizeFrameBy(Int16 inWidthDelta, Int16 inHeightDelta, Boolean inRefresh);
virtual void MoveBy(Int32 inHorizDelta, Int32 inVertDelta, Boolean inRefresh);
virtual void SetValue(SInt32 inValue);
protected:
// PowerPlant overrides
virtual void FinishCreateSelf();
virtual void DrawSelf();
virtual void ClickSelf(const SMouseDownEvent &inMouseDown);
virtual void EnableSelf();
virtual void DisableSelf();
virtual void HotSpotResult(SInt16 inHotSpot);
virtual void CreateAGAObject();
};
#pragma mark AGAProgressIndicatorPP
//
// AGAProgressIndicatorPP -------------------------------------------------------
//
// LControl subclass. Use the standard LControl value methods to set the
// progress indicator range and value. Access the AGAProgressIndicator
// directly to set the origin value if desired. If you set the min equal
// to the max, it will be an indeterminate progress indicator; if the
// mUserCon is non-zero, it will call this->StartAutoAnimate automatically
// when it is created so that you don't have to start the animation running.
//
class AGAProgressIndicatorPP : public LControl, public LPeriodical
{
public:
AGAProgressIndicatorPP();
AGAProgressIndicatorPP(LStream* inStream);
virtual ~AGAProgressIndicatorPP();
AGAProgressIndicator* mAGAObject;
enum { class_ID = 'GCpr' };
static AGAProgressIndicatorPP* CreateStream(LStream* inStream);
// PowerPlant overrides
virtual void ResizeFrameBy(Int16 inWidthDelta, Int16 inHeightDelta, Boolean inRefresh);
virtual void MoveBy(Int32 inHorizDelta, Int32 inVertDelta, Boolean inRefresh);
virtual void SetValue(SInt32 inValue);
virtual void SetMinValue(SInt32 inMinValue);
virtual void SetMaxValue(SInt32 inMaxValue);
virtual void SpendTime(const EventRecord &inMacEvent);
// For an indeterminate progress indicator, you can use these functions
// to set it running or stop it. It will start the LPeriodical repeating
// and do a quantized animate at idle time.
void StartAutoAnimate();
void StopAutoAnimate();
protected:
// PowerPlant overrides
virtual void FinishCreateSelf();
virtual void DrawSelf();
virtual void CreateAGAObject();
};
#pragma mark AGAWhiteBackgroundAttachmentPP
//
// AGAWhiteBackgroundAttachmentPP ----------------------------------------------------
//
// An attachment that you should attach to any subview where the window has
// a gray background but the particular subview needs a white background.
// Editable text fields and list boxes are the most common examples.
// AGAEditFieldPP and AGAListBoxPP both add one of these automatically.
//
class AGAWhiteBackgroundAttachmentPP : public LAttachment
{
public:
AGAWhiteBackgroundAttachmentPP(MessageT inMessage = msg_DrawOrPrint, Boolean inExecuteHost = true);
AGAWhiteBackgroundAttachmentPP(LStream *inStream);
enum { class_ID = 'GCwa' };
static AGAWhiteBackgroundAttachmentPP* CreateStream(LStream* inStream);
virtual Boolean Execute(MessageT inMessage, void *ioParam);
protected:
Boolean mIsNotched;
};
#pragma mark AGANotchedWhiteBackgroundAttachmentPP
//
// AGANotchedWhiteBackgroundAttachmentPP ----------------------------------------------------
//
// An AGAWhiteBackgroundAttachmentPP that accounts for a "notch" in
// the white background at the bottom right corner such as left by
// a pair of scroll bars.
//
class AGANotchedWhiteBackgroundAttachmentPP : public AGAWhiteBackgroundAttachmentPP
{
public:
AGANotchedWhiteBackgroundAttachmentPP(MessageT inMessage = msg_DrawOrPrint, Boolean inExecuteHost = true);
AGANotchedWhiteBackgroundAttachmentPP(LStream *inStream);
enum { class_ID = 'GCnw' };
static AGANotchedWhiteBackgroundAttachmentPP* CreateStream(LStream* inStream);
};
#pragma mark AGABorderFrameAttachmentPP
//
// AGABorderFrameAttachmentPP ----------------------------------------------------
//
// An attachment that you should attach to any subview where the subview
// needs a "3D" sunken frame around it. Editable text fields and list
// boxes are the most common examples.
// AGAEditFieldPP and AGAListBoxPP both add one of these automatically.
//
class AGABorderFrameAttachmentPP : public LAttachment
{
public:
AGABorderFrameAttachmentPP(MessageT inMessage = msg_DrawOrPrint, Boolean inExecuteHost = true);
AGABorderFrameAttachmentPP(LStream *inStream);
enum { class_ID = 'GCba' };
static AGABorderFrameAttachmentPP* CreateStream(LStream* inStream);
virtual Boolean Execute(MessageT inMessage, void *ioParam);
protected:
Boolean mIsNotched;
};
#pragma mark AGANotchedBorderFrameAttachmentPP
//
// AGANotchedBorderFrameAttachmentPP ----------------------------------------------------
//
// An AGABorderFrameAttachmentPP that accounts for a "notch" in
// the contour at the bottom right corner such as left by
// a pair of scroll bars.
//
class AGANotchedBorderFrameAttachmentPP : public AGABorderFrameAttachmentPP
{
public:
AGANotchedBorderFrameAttachmentPP(MessageT inMessage = msg_DrawOrPrint, Boolean inExecuteHost = true);
AGANotchedBorderFrameAttachmentPP(LStream *inStream);
enum { class_ID = 'GCnb' };
static AGANotchedBorderFrameAttachmentPP* CreateStream(LStream* inStream);
};
#pragma mark AGAEditFieldPP
//
// AGAEditFieldPP -------------------------------------------------------
//
// LEditField subclass that attaches an AGAWhiteBackgroundAttachmentPP
// and an AGABorderFrameAttachmentPP to itself.
// It also knows how to draw the disabled text frame in gray color
// rather than dithered black pattern.
//
class AGAEditFieldPP : public LEditField
{
public:
AGAEditFieldPP();
AGAEditFieldPP(LStream* inStream);
virtual ~AGAEditFieldPP();
enum { class_ID = 'GCed' };
static AGAEditFieldPP* CreateStream(LStream* inStream);
protected:
virtual void DrawSelf();
virtual void DrawBox();
virtual void DrawEverything(); // DrawSelf and DrawBox just need to draw everything,
// incl. frame, shadowing, bg, text
};
#pragma mark AGATextEditPP
//
// AGATextEditPP -------------------------------------------------------
//
// LTextEdit subclass that attaches an AGAWhiteBackgroundAttachmentPP
// and an AGABorderFrameAttachmentPP to itself.
//
class AGATextEditPP : public LTextEdit
{
public:
AGATextEditPP();
AGATextEditPP(LStream* inStream);
virtual ~AGATextEditPP();
enum { class_ID = 'GCte' };
static AGATextEditPP* CreateStream(LStream* inStream);
protected:
// PowerPlant overrides
virtual void DrawSelf();
};
#pragma mark AGASeparatorPP
//
// AGASeparatorPP -------------------------------------------------------
//
// LPane subclass that implements an AGA separator.
//
class AGASeparatorPP : public LPane
{
public:
AGASeparatorPP();
AGASeparatorPP(LStream* inStream);
virtual ~AGASeparatorPP();
AGASeparator* mAGAObject;
enum { class_ID = 'GCse' };
static AGASeparatorPP* CreateStream(LStream* inStream);
// PowerPlant overrides
virtual void ResizeFrameBy(Int16 inWidthDelta, Int16 inHeightDelta, Boolean inRefresh);
virtual void MoveBy(Int32 inHorizDelta, Int32 inVertDelta, Boolean inRefresh);
protected:
// PowerPlant overrides
virtual void FinishCreateSelf();
virtual void DrawSelf();
virtual void CreateAGAObject();
};
#pragma mark AGACaptionPP
//
// AGACaptionPP -------------------------------------------------------
//
// LCaption replacement subclass. Erases pane to gray before allowing
// standard LCaption drawing.
//
class AGACaptionPP : public LCaption
{
public:
AGACaptionPP();
AGACaptionPP(LStream* inStream);
virtual ~AGACaptionPP();
enum { class_ID = 'GCca' };
static AGACaptionPP* CreateStream(LStream* inStream);
protected:
// PowerPlant overrides
virtual void FinishCreateSelf();
virtual void DrawSelf();
virtual void EnableSelf();
virtual void DisableSelf();
RGBColor mEnabledBackgroundColor;
RGBColor mDisabledBackgroundColor;
};
#pragma mark AGAListBoxPP
//
// AGAListBoxPP -------------------------------------------------------
//
// LListBox replacement subclass that replaces the default LFocusBox
// with an AGAFocusBoxPP AGA-style focus frame, and attaches an
// AGAWhiteBackgroundAttachmentPP and an AGABorderFrameAttachmentPP to
// itself.
//
class AGAListBoxPP : public LListBox
{
public:
AGAListBoxPP();
AGAListBoxPP(LStream* inStream);
virtual ~AGAListBoxPP();
enum { class_ID = 'GClb' };
static AGAListBoxPP* CreateStream(LStream* inStream);
protected:
// PowerPlant overrides
virtual void FinishCreateSelf();
virtual void DrawSelf();
virtual void ActivateSelf();
virtual void DeactivateSelf();
virtual void EnableSelf();
virtual void DisableSelf();
enum { kUseUpdateRgn = true, kDontUseUpdateRgn = false }; // for readability
virtual void DrawEverything(Boolean useUpdateRgn); // DrawSelf, activate/deactivate, enable/disable just
// need to draw everything, incl. frame, shadowing, bg, text
Boolean mNotchedFrame;
Boolean mNotchedFocusBox;
};
#pragma mark AGANotchedListBoxPP
//
// AGANotchedListBoxPP -------------------------------------------------------
//
// An AGAListBoxPP that draws uses notched border frame and notched
// target border.
//
class AGANotchedListBoxPP : public AGAListBoxPP
{
public:
AGANotchedListBoxPP();
AGANotchedListBoxPP(LStream* inStream);
virtual ~AGANotchedListBoxPP();
enum { class_ID = 'GCnl' };
static AGANotchedListBoxPP* CreateStream(LStream* inStream);
};
#pragma mark AGANotchedFocusListBoxPP
//
// AGANotchedFocusListBoxPP -------------------------------------------------------
//
// An AGAListBoxPP that draws uses notched border frame and notched
// target border.
//
class AGANotchedFocusListBoxPP : public AGANotchedListBoxPP
{
public:
AGANotchedFocusListBoxPP();
AGANotchedFocusListBoxPP(LStream* inStream);
virtual ~AGANotchedFocusListBoxPP();
enum { class_ID = 'GCnt' };
static AGANotchedFocusListBoxPP* CreateStream(LStream* inStream);
};
#pragma mark AGAFocusBoxPP
//
// AGAFocusBoxPP -------------------------------------------------------
//
// LFocusBox replacement subclass that implements an AGA focus frame.
// The AGAListBoxPP class replaces the standard LFocusBox with one of
// these.
//
class AGAFocusBoxPP : public LFocusBox
{
public:
AGAFocusBoxPP();
AGAFocusBoxPP(const LFocusBox &inOriginal);
AGAFocusBoxPP(LStream* inStream);
virtual ~AGAFocusBoxPP();
enum { class_ID = 'GCfb' };
static AGAFocusBoxPP* CreateStream(LStream* inStream);
protected:
// PowerPlant overrides
virtual void DrawSelf();
virtual RgnHandle GetBoxRegion(const Rect &inFrame, const Rect &inRevealed) const;
Boolean mIsNotched;
};
#pragma mark AGANotchedFocusBoxPP
//
// AGANotchedFocusBoxPP -------------------------------------------------------
//
// An AGAFocusBoxPP that accounts for a "notch" in
// the contour at the bottom right corner such as left by
// a pair of scroll bars.
//
class AGANotchedFocusBoxPP : public AGAFocusBoxPP
{
public:
AGANotchedFocusBoxPP();
AGANotchedFocusBoxPP(const LFocusBox &inOriginal);
AGANotchedFocusBoxPP(LStream* inStream);
virtual ~AGANotchedFocusBoxPP();
enum { class_ID = 'GCnf' };
static AGANotchedFocusBoxPP* CreateStream(LStream* inStream);
};
#pragma mark AGATabPanelPP
//
// AGAPanelEnclosurePP ----------------------------------------------------
//
// LView + LCommander mixin class that should be used as the root view
// of your individual tab panel PPob resources. It's OK to just use a
// plain LView, but in that case commander targeting cannot be handled
// by AGATabPanelPP and may result in less-than-ideal activation of
// things like edit text fields as you switch between panels.
//
class AGAPanelEnclosurePP : public LView, public LCommander
{
public:
AGAPanelEnclosurePP();
AGAPanelEnclosurePP(LStream* inStream);
virtual ~AGAPanelEnclosurePP();
enum { class_ID = 'GCpe' };
static AGAPanelEnclosurePP* CreateStream(LStream* inStream);
virtual void SwitchPanelOut();
virtual void SwitchPanelIn();
};
//
// AGATabPanelPP ----------------------------------------------------
//
// LView subclass for AGATabPanel set for large tabs. When instantiated
// from a view resource, the mUserCon, if non-zero, is used as the resource
// ID of an 'STR#' resource that contains the tab labels; the number of
// tabs will be the number of strings in the 'STR#' resource. If you have
// existing tabs, such as via the 'STR#', use InstallPanel to assign a
// panel to a tab. If you have no tabs yet, use AddPanel to create a new
// tab for a panel. Note that the panel views must be non-window 'PPob'
// resources, i.e. view hierarchies with an LView at the root, not an LWindow.
//
class AGATabPanelPP : public LView
{
public:
AGATabPanelPP();
AGATabPanelPP(LStream* inStream);
virtual ~AGATabPanelPP();
AGATabPanel* mAGAObject;
enum { class_ID = 'GCtp' };
static AGATabPanelPP* CreateStream(LStream* inStream);
// PowerPlant overrides
virtual void ResizeFrameBy(Int16 inWidthDelta, Int16 inHeightDelta, Boolean inRefresh);
virtual void MoveBy(Int32 inHorizDelta, Int32 inVertDelta, Boolean inRefresh);
virtual void SetValue(SInt32 inValue);
virtual SInt32 GetValue() const;
virtual void Disable();
// HandleTabSwitch can be used to switch to the specified panel,
// but it will call ValidatePanel before allowing the switch.
// This is what ClickSelf does to handle a click in a tab.
// To switch directly without validation, just call SetValue.
virtual void HandleTabSwitch(SInt32 newTabIndex);
// AddPanel adds another tab, and assigns it the specified 'PPob' view.
// If the specified label StringPtr is NULL, the 'PPob' rsrc name is used.
virtual void AddPanel(ResIDT panelResourceID,
StringPtr tabLabel);
// InstallPanel assigns the specified 'PPob' view to the specified
// existing tab. If the specified label StringPtr is NULL, the existing
// tab label is left untouched.
virtual void InstallPanel(SInt32 tabIndex,
ResIDT panelResourceID,
StringPtr tabLabel);
// GetPanelView returns the LView pointer to the root of the
// pane hierarchy of the specified tab.
virtual LView* GetPanelView(SInt32 tabIndex);
protected:
// PowerPlant overrides
virtual void FinishCreateSelf();
virtual void DrawSelf();
virtual void ClickSelf(const SMouseDownEvent &inMouseDown);
virtual void EnableSelf();
virtual void DisableSelf();
virtual void CreateAGAObject();
virtual void CreateContainerView();
// Override ValidatePanel if you need to perform validation
// before allowing the user to switch panels.
virtual Boolean ValidatePanel(SInt32 currentTabIndex);
virtual void SwitchPanels(SInt32 newTabIndex);
virtual void SwitchPanelOut();
virtual void SwitchPanelIn(SInt32 newTabIndex);
SInt16 mLabelsResourceID;
ResIDT mLabelsTextTraitsID;
LView* mPanelContainerView;
LView* mActivePanelView;
Boolean mTempSupressDisable; // workaround -- see Disable() method
};
#pragma mark AGATabPanelPPX
//
// AGATabPanelPPX ----------------------------------------------------
//
// Extended AGATabPanelPP class for use with custom pane template.
// The labels STR# resource ID and text traits ID are read from the stream.
// The AGA standard for small tabs is Geneva 10pt bold.
// If you use a font size greater than 10, the tabs will be "large".
// If you use a font size of 10 or less, the tabs will be "small".
//
class AGATabPanelPPX : public AGATabPanelPP
{
public:
AGATabPanelPPX(LStream* inStream);
virtual ~AGATabPanelPPX();
enum { class_ID = 'GXtp' };
static AGATabPanelPPX* CreateStream(LStream* inStream);
};
#pragma mark AGASmallTabPanelPP
//
// AGASmallTabPanelPP ----------------------------------------------------
//
// AGATabPanelPP subclass that implements folder tabs, set for "small"
// tab appearance.
//
class AGASmallTabPanelPP : public AGATabPanelPP
{
public:
AGASmallTabPanelPP(LStream* inStream);
virtual ~AGASmallTabPanelPP();
enum { class_ID = 'GCts' };
static AGASmallTabPanelPP* CreateStream(LStream* inStream);
protected:
// After creating the object we set the tab size and text style
// to the standard small appearance.
virtual void CreateAGAObject();
};
#endif // __GRAYCOUNCILPP__